import java.util.*;

public class Player
{
    private int strength = 100;
    private Map<String, Thing> bag = new HashMap<>();
    
    public void step() {
        this.strength -= 10;
    }
    
    public void eat(String thingName) {
        Thing thing = bag.get(thingName);
        if(thing != null) {
            this.strength += thing.getEnergy();
            if(this.strength > 100){
                this.strength = 100;
            }
            System.out.println("你吃掉了" + thingName);
            bag.remove(thingName);
        }
    }
    
    public void pick(Thing thing) {
        bag.put(thing.getName(), thing);
    }
    
    public void checks(){
        for(String key : bag.keySet()){
            System.out.println(" " + key);
        }
    }
}
